﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace Super64.Core.Memory.Rom
{
    [StructLayout(LayoutKind.Sequential)]
    public unsafe struct CartHeader
    {
        public byte PI_BSB_DOM1_LAT_REG;
        public byte PI_BSB_DOM1_PGS_REG;
        public byte PI_BSB_DOM1_PWD_REG;
        public byte PI_BSB_DOM1_PGS_REG_2;
        public uint ClockRate;
        public uint ProgramCounter;
        public uint Release;
        public uint CRC1;
        public uint CRC2;
        public ulong Unknown;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 20)]
        public string ImageName;
        public uint Unknown2;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 2)]
        public string MalfactureID;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 2)]
        public string CartID;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 2)]
        public string CountryCode;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = (1008 * 4))]
        public byte[] BootCode;
    }
}
